-
Notifications
You must be signed in to change notification settings - Fork 225
Conversation
61a6bda
to
212f5de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start @nickva thanks for starting this
212f5de
to
1c4169a
Compare
This sounds Very good! Thank you very much. Is the data model for this lightweight to use with good API and manage progress/backlog/and so for "middle-tier" tasks? Think of use-cases being served in old style database with asynchronous triggers following API calls, to change paradigm, like Kafka with consumer-groups. Software agents can connect to couchdb's job-service api, claim ready to serve shard of queue for specific application-layer job, get change-stream like replication queue and post notifications if needed to show progress. It can be simpler and get good help from job infrastructure, make business infrastructure easier to control and manage. They enjoy most of same things like indexing does, optional "reprocess whole database", live processing of newest records even during rebuild and so. |
Ah, that's an interesting idea. The background jobs systems could in theory accept jobs from the outside if there was an HTTP API wrapper around it. So far in the design, jobs's keys and values are FDB tuples and/or json encoded objects so it seems doable. Perhaps something for a future iteration... We also mention that workers could be implemented as any process which can connect to the FDB cluster. Generally it will be Erlang processes (or applications) but those workers could be written in other language as long as they can talk to the FDB cluster. And we might even end up with that when implementing some of the secondary indexing work. Having a completely custom set of workers, and a more fleshed out API for the workers to claim and do work would be possible. But I suggest we leave that for the future as well. |
for now, could highlight the integration spots to decrease odds that "future" resolves to "never". Thanks! |
ca38810
to
fc72fcf
Compare
82fb337
to
a63a147
Compare
Thank you all for the feedback. Taking it into consideration, and also
|
a63a147
to
33b9582
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice and much clearer than the original worker rfc. Nice work.
33b9582
to
597c3a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super awesome work on this! I'm quite like how the overall structure has turned out and made the whole approach seem a lot more intuitive.
I would like to spend some effort reorganizing the layout of this doc though. I could see this either being the basis for or even just as-is the documentation for a developer that wants to implement a new job type. As is that developer would have to read the entire document and comprehend the entire structure and implementation of job processing before being certain that a job processing implementation was correct. I think splitting it out into a few more sections that go from high level to progressively lower level details would be quite helpful for future when we've paged this out of brain cache and accidentally overwritten those meat sectors with intervening years of coding. I'd propose something like the following:
- Front matter
- Reason for existence
- High-level description of a job
- API description from the developer point of view
- Internals concepts
- API algorithm descriptions
- Explicit data model
- API implementation referencing fdb level functions and data model
- Mutual exclusion (if not sufficiently covered in 8)
- Activity monitor (samesies if not covered)
All of those things already exist, but they're jumbled around in such a way that makes the various concepts hard to absorb. I tend to think of it as starting high level and then working towards actual bytes. I'm basically thinking that sections 3 and 4 should basically contain enough information for a developer implementing a new job type and then everything else just gets progressively closer to the actual fdb interface.
Again, super awesome work!
2a6f306
to
cc99b71
Compare
@davisp, @garrensmith Thanks for the great comments and input. I had pushed the update that hopefully addresses most of the issues. I think the API looks cleaner and the structure of the RFC is more reasonable as well. |
cc99b71
to
659941b
Compare
659941b
to
1f8c2ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes. But really nice RFC. Really nice and clear.
Jobs in the system can be in a few different states. After a job is added and | ||
is waiting to run, the job is considered to be `pending`. A job executed by | ||
a job processor is considered to be `running`. When a job is neither `running`, | ||
nor `pending`, it is considered to be `finished`. This is the state transition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mention that a finished job could be resubmitted later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the job was running, then resubmitting it would make it pending again after the job processor calls finish
. However if it already finished, then it won't start running again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was updated such that job creator can just call add/4,5
again. If the job is running it will be flagged to be re-enqueued when it finishes. If it is pending, only the scheduled time value may be updated (if provided). If the job was already finished it is re-enqueued for execution.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
1f8c2ac
to
d98ee3f
Compare
d98ee3f
to
d065db3
Compare
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
d065db3
to
de330f5
Compare
de330f5
to
7b795d4
Compare
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
@davisp @garrensmith @nickva is this one approved and ready to merge? I don't see any outstanding comments |
I think I addressed most of the issues. Didn't know if @davisp wanted to take another look at it |
I haven't got anything to add. |
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
RFC: apache/couchdb-documentation#409 Main API is in the `couch_jobs` module. Additional description of internals is in the README.md file.
No description provided.